package edu.whu.rose.clock.ssql.binding;

import com.sleepycat.bind.tuple.TupleBinding;
import com.sleepycat.bind.tuple.TupleInput;
import com.sleepycat.bind.tuple.TupleOutput;

import edu.whu.rose.clock.kps.datastruct.SimpleSubgraphVertex;

public class SubgraphVertexBinding extends TupleBinding {

	public Object entryToObject(TupleInput input) {
		int subgraph = input.readInt();
		int vertex = input.readInt();
		return new SimpleSubgraphVertex(subgraph, vertex);
	}

	public void objectToEntry(Object object, TupleOutput output) {
		SimpleSubgraphVertex ssv = (SimpleSubgraphVertex) object;
		output.writeInt(ssv.getSubgraph_id());
		output.writeInt(ssv.getVertex_id());
	}

}
